<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		*{
			margin:0;padding:0;
		}
		.form{
			display: block;
			width:400px;
			line-height: 40px;
			margin-left: 40px;
		}
		label{
			color:#000;
		}
		input[type='text']{
			padding:2px;
			line-height: 20px;
			border:1px solid #000;
			outline: none;
		}
		a{
			text-decoration: none;
			color:#fff;
			padding:10px;
			background: #5FB878;
		}

	</style>
</head>
<body>
	<form action="#">
		<div class="form">
			<label>标题</label>
			<input type="text" name='title' value="{$friends.title|default=''}">
		</div>
		<div class="form">
			<label>地址</label>
			<input type="text" name='url' value="{$friends.url|default='http://'}">
			<label style='color:#666;font-size:12px;'>必须带上http://</label>
		</div>
		<div class="form">
			<label>是否新窗口打开</label>
			<input type="checkbox" name='_blank' value="1" <eq name='friends._blank' value='1'>checked</eq>>
		</div>
		<div class="form">
			<a href="#" id='confirm'>确认</a>
		</div>
		<notempty name='id'>
			<input type="hidden" name='id' value="{$id}">
		</notempty>
	</form>
	<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
    <script type="text/javascript" src='http://apps.bdimg.com/libs/layer/2.1/layer.js'></script>
	<script type="text/javascript">	
			$('#confirm').on('click' , function(){
				$.post('__SELF__', $('form').serialize() , function(data){
					if(data.status){
						layer.msg(data.info);
						setTimeout(function(){
							parent.window.location.reload();
						},2000);
					}
				});
			});
	</script>
</body>
</html>